/*     */ package com.zimbra.cs.redolog;
/*     */ 
/*     */ import java.io.IOException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class Version
/*     */ {
/*     */   private static final short CURRENT_MAJOR = 1;
/*     */   private static final short CURRENT_MINOR = 42;
/*     */   private short mMajorVer;
/*     */   private short mMinorVer;
/*     */   
/*     */   public static Version latest()
/*     */   {
/*  41 */     return new Version(1, 42);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public Version()
/*     */   {
/*  48 */     this.mMajorVer = 1;
/*  49 */     this.mMinorVer = 42;
/*     */   }
/*     */   
/*     */   public Version(int major, int minor) {
/*  53 */     this.mMajorVer = ((short)major);
/*  54 */     this.mMinorVer = ((short)minor);
/*     */   }
/*     */   
/*     */   public Version(Version b) {
/*  58 */     this(b.mMajorVer, b.mMinorVer);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean atLeast(int major, int minor)
/*     */   {
/*  66 */     return (this.mMajorVer > major) || ((this.mMajorVer == major) && (this.mMinorVer >= minor));
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean atLeast(Version b)
/*     */   {
/*  74 */     return atLeast(b.mMajorVer, b.mMinorVer);
/*     */   }
/*     */   
/*     */   public boolean isLatest() {
/*  78 */     return (this.mMajorVer == 1) && (this.mMinorVer == 42);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public boolean tooHigh()
/*     */   {
/*  86 */     return (this.mMajorVer > 1) || ((this.mMajorVer == 1) && (this.mMinorVer > 42));
/*     */   }
/*     */   
/*     */   public String toString()
/*     */   {
/*  91 */     return Integer.toString(this.mMajorVer) + "." + Integer.toString(this.mMinorVer);
/*     */   }
/*     */   
/*     */   public void serialize(RedoLogOutput out) throws IOException {
/*  95 */     out.writeShort(this.mMajorVer);
/*  96 */     out.writeShort(this.mMinorVer);
/*     */   }
/*     */   
/*     */   public void deserialize(RedoLogInput in) throws IOException {
/* 100 */     this.mMajorVer = in.readShort();
/* 101 */     this.mMinorVer = in.readShort();
/* 102 */     if ((this.mMajorVer < 0) || (this.mMinorVer < 0))
/* 103 */       throw new IOException("Negative version number: major=" + this.mMajorVer + ", minor=" + this.mMinorVer);
/*     */   }
/*     */   
/*     */   public boolean equals(Object obj) {
/* 107 */     Version b = (Version)obj;
/* 108 */     return (b != null) && (b.mMajorVer == this.mMajorVer) && (b.mMinorVer == this.mMinorVer);
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/Version.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */